package com.echovin.esb.gateway.mapper;

import com.echovin.esb.gateway.model.GatewayServer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.cloud.gateway.route.RouteDefinition;

import java.util.List;

@Mapper
public interface GatewayRouteMapper {
    @Select("select ROUTE_RULE from GATEWAY_SERVICE")
    List<String> getRoutes();
    @Update("update GATEWAY_SERVICE set ROUTE_RULE = null, UPDATER = #{record.updater}, UPDATE_TIME = #{record.updateTime} where ID = #{record.id}")
    int delete(GatewayServer record);
    @Update("update GatewayServer set ROUTE_RULE = #{record.routeRule}, UPDATER = #{record.updater}, UPDATE_TIME = #{record.updateTime} where ID = #{record.id}")
    int update(GatewayServer record);
}
